/*
{
  "page": 1,
  "total": 4,
  "files": [
    {
      "id": 4,
      "hash": "e777dfd969c39356daa6f6712db31fe7fade5a53",
      "name": "IMG_20170308_144625.jpg",
      "thumb": "123"
    }
  ]
}
 */
class AlbumFileListResponse {
  List<AlbumFileItem> files;
  int page;
  int total;

  AlbumFileListResponse({this.files, this.page, this.total});

  factory AlbumFileListResponse.fromJson(Map<String, dynamic> json) {
    return AlbumFileListResponse(
      files: json['files'] != null ? (json['files'] as List).map((i) => AlbumFileItem.fromJson(i)).toList() : null,
      page: json['page'],
      total: json['total'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['page'] = this.page;
    data['total'] = this.total;
    if (this.files != null) {
      data['files'] = this.files.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class AlbumFileItem {
  String hash;
  int id;
  String name;
  String thumb;

  AlbumFileItem({this.hash, this.id, this.name, this.thumb});

  factory AlbumFileItem.fromJson(Map<String, dynamic> json) {
    return AlbumFileItem(
      hash: json['hash'],
      id: json['id'],
      name: json['name'],
      thumb: json['thumb'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['hash'] = this.hash;
    data['id'] = this.id;
    data['name'] = this.name;
    data['thumb'] = this.thumb;
    return data;
  }

}